package T4.EjemplosDelSwing.ejemplosgui;

import javax.swing.*;
import java.awt.event.*;

class Frame3 extends JFrame {

    public Frame3() {
        setTitle("Hola!!!");
        setSize(300, 200);
        addWindowListener(new manejador3());
    }
}

class manejador3 extends WindowAdapter {

    @Override
    public void windowClosing(WindowEvent e) {
        System.out.println("sali");
        System.exit(0);
    }
}

public class Ejemplo3 {

    public static void main(String[] args) {
        JFrame frame = new Frame3();
        frame.setVisible(true);
    }
}
